package com.suse.springbook.dao;

import com.suse.springbook.model.BookInfo;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

@Repository
public class BookDao {
    public List<BookInfo> mookData() {
        List<BookInfo> bookInfos = new ArrayList<>();
        for (int i = 0; i < 15; i++) {
            BookInfo book = new BookInfo();
            book.setId(i);
            book.setBookName("图书"+i);
            book.setCount(i*15+1);
            book.setPrice(new BigDecimal(22*i+5-0.5*i));
            book.setAuthor("作者"+i);
            book.setStatus(i%5==0?2:1);
            book.setPublish("出版社"+i);
            bookInfos.add(book);
        }
        return bookInfos;
    }
}
